#pragma once

#include <stdint.h>
#include <map>
#include <functional>


template <typename F>
class Callbacks
{
public:

    class ID
    {
    public:
        bool operator<(const ID &b) const {
            return id_ < b.id_;
        }

    private:
        ID(uint64_t id): id_(id) {}

        const uint64_t id_;
    };

private:
    uint64_t nextId() {
        return ++nextId_;
    }

private:
    uint64_t nextId_ = 0;

    std::map<uint64_t, std::function<F>> callbacks_;
};
